#include<bits/stdc++.h>
using namespace std;

signed main() {
	double x, s;
	s = 1;
	scanf("%lf", &x);

	double fenMu = 3, f = -1;
	while (1 / fenMu >= x) {
		s += 1 / fenMu * f;
		fenMu += 3;
		f *= -1;
	}
	printf("%.4lf", s);
	return 0;
}
